<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%
	String baseP = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ "/";
%>

<!doctype html>
<html>
<head>
<title>违法查询</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="cleartype" content="on" />
<link rel="shortcut icon" href="/nocontent" />
<script type="text/javascript"
		 src="<c:url value='/resource/js/jquery-2.0.min.js'/>"></script>
	<script type="text/javascript"
			src="<c:url value='/resource/easyui/easyloader.js'/>"></script>

<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width,user-scalable=no" />
<meta name="viewport" id="viewport" />
<%--<link rel="stylesheet"
	href="<c:url value='/static/common/css/work-WZCXInfo.css'/>" />
--%>
<script type="text/javascript"
	src="<c:url value='/resource/js/jquery-1.11.0.min.js'/>"></script>
<style type="text/css">
body {
	background-color: #F0F0F0;
	margin: 0px;
}

a {
	text-decoration: none;
	cursor: pointer;
	color: #666;
	outline: none;
	font-size: 12px;
}

.items {
	margin-top: 2px;
	width: 100%;
	height: 120px;
	width: 100%;
	border: none;
	padding: 4px 0px 0px 2px;
	border-bottom:1px solid #ddd;
}

#img {
	float: left;
	position: relative;
	left: 1px;
	width: 100px;
	height: 100px;
}
#img img{
	vertical-align: middle;
	margin-top:20px;
	width: 100px;
	height: auto;
}

.content {
	float: left;
	width: 60%;
	left: 2px;
	font-size: 12px;
	margin-left: 10px;
	line-height:22px;
	font-family: "微软雅黑";
}

.driver_content {
	width: 60%;
	margin: auto;
}

#result {
	width: 35%;
	margin: 50px auto;
}
</style>
<script type="text/javascript">
	$(function() {
		var carordriver = "${carordriver}";
		if(0 == carordriver){
			$.ajax({
					url : "http://221.224.13.5:8190/econsole/api/query/violation/vehicle",
					type : "post",
					data : {
						"license" : "${CarId_one}",
						"vin" : "${CarId_two}"
					},
					timeout : 6000,
					success : function(resp) {
						var resultdata = resp.data;
						if (resp.succ) {
							if(null != resultdata&&"" !=resultdata){
								for ( var i = 0; i < resultdata.length; i++) {

									var provider = resultdata[i].provider;
									var time = resultdata[i].time;
									var address = resultdata[i].address;
									var violation = resultdata[i].violation;
									var photo = resultdata[i].photos;
									var data = provider + ",,," + time + ",,,"
											+ address + ",,," + violation + ",,,"
											+ photo;
									var url = "<c:url value='/police/WZCXDetail'/>?data="
											+ escape(encodeURIComponent(data));
									if (resultdata[i].photos!=null&&resultdata[i].photos.length > 0) {
										photo = resultdata[i].photos[0];
									} else {
										photo = "<c:url value='/resource/images/query_result_pic.jpg'/>";
									}
									$("body")
											.append(
													"<div class='items'><a href='"+ url+"'><div id='img'><img src='"+photo+"'></div><div class='content'><span>编号：</span><span>"
															+ resultdata[i].sn
															+ "</span><br>"
															+ "<span>时间：</span><span>"
															+ resultdata[i].time
															+ "</span><br>"
															+ "<span>地址：</span><span>"
															+ resultdata[i].address
															+ "</span><br>"
															+ "<span>罚款：</span><span>"
															+ resultdata[i].fins
															+ "</span>&nbsp;&nbsp;&nbsp;"
															+ "<span>扣款：</span><span>0</span><br>"
															+ "<span>状态：</span><span>"
															+ resultdata[i].payFineFlag
															+ "</span><div></a><div>");
								}
							}
							else {
								$("#result").css("display", "block").html(
									"没有查询到违章信息");
							}
						} else {
							$("#result").css("display", "block").html(
									"没有查询到违法信息");
						}
					},
					error : function() {
						$("#result").css("display", "block").html("没有查询到违法信息");
					}
				});
			}
			if(1 == carordriver){
				$
				.ajax({
					url : "http://221.224.13.5:8190/econsole/api/query/violation/driver",
					type : "post",
					data : {
						"drivingLicense" : "${drive_license}",
						"fn" : "${fn}"
					},
					timeout : 6000,
					success : function(resp) {
						var resultdata = resp.data;
						if (resp.succ) {
							if(null != resultdata){
//								for ( var i = 0; i < resultdata.length; i++) {
									$("body")
											.append(
													"<div class='items'><div class='driver_content'><span>姓名：</span><span>"
															+ resultdata.XM
															+ "</span><br>"
															+ "<span>准驾车型：</span><span>"
															+ resultdata.ZJCX
															+ "</span><br>"
															+ "<span>有效期止：</span><span>"
															+ resultdata.YXQZ
															+ "</span><br>"
//															+ "<span>状态：</span><span>"
//															+ resultdata.ZT
//															+"</span><br>"
															+ "<span>累计积分：</span><span>"
															+ resultdata.LJJF
//															+"</span><br>"
//															+"<span>证芯编号：</span><span>"
//															+ resultdata.ZXBH
//															+"</span><br>"
//															+"<span>审验日期:</span><span>"
//															+ resultdata.SYRQ
//															+"</span><br>"
//															+"<span>清分日起:</span><span>"
//															+ resultdata.QFRQ
															+ "</span></div></div>");
//								}
							}
							else {
								$("#result").css("display", "block").html(
									"没有查询到信息");
							}
						} else {
							$("#result").css("display", "block").html(
									"没有查询到违法信息");
						}
					},
					error : function() {
						$("#result").css("display", "block").html("没有查询到违法信息");
					}
				});
			}
	});
</script>
</head>
<body>
	<div id="result" style="display: none;"></div>
</body>
</html>
